-- GENERATED SPELL FOR [Grimtotem Shaman] --


function spell0_7727(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(930,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7727', 2000, 1)
end

function spell1_7727(pUnit, Event) --@Fire Nova Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(8499,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_7727', 1, 1)
end

function spell2_7727(pUnit, Event) --@Healing Wave,Heal--
pUnit:FullCastSpellOnTarget(8005,pUnit)
pUnit:RegisterEvent('Sorts_7727', 3000, 1)
end

function Sorts_7727(pUnit, Event)
local choix_sorts_7727 = math.random(0, 2)
if choix_sorts_7727 == 0 then
pUnit:RegisterEvent('spell0_7727', 1, 1)
end
if choix_sorts_7727 == 1 then
pUnit:RegisterEvent('spell1_7727', 1, 1)
end
if choix_sorts_7727 == 2 then
pUnit:RegisterEvent('spell2_7727', 1, 1)
end
end

function mob7727_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_7727', math.random(1500, 3000), 1)
end

function mob7727_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7727_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7727_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(7727, 1, 'mob7727_Action')
RegisterUnitEvent(7727, 2, 'mob7727_Leave')
RegisterUnitEvent(7727, 3, 'mob7727_Kill')
RegisterUnitEvent(7727, 4, 'mob7727_Die')
